/**
 * 随机生成一定范围内的偶数[0, rang)
 * @param number
 * @param range
 * @returns {Array}
 */
function createEven(number, range) {
  var res = [];
  while (res.length < number) {
    var tn = Math.floor(Math.random() * range);
    if(tn % 2 === 0 && !inArray(res, tn)){
      res.push(tn);
    }
  }
  return res;
}

/**
 *
 * @param array
 * @param el
 * @returns {boolean}
 */
function inArray(array, el) {
  var isInArray = false;
  for (var i = 0; i < array.length; i += 1){
    if (array[i] === el){
      isInArray = true;
    }
  }
  return isInArray;
}
